fix(gcs): map cacheControl and customTime on the gRPC object path - #184
fix(gcs): map cacheControl and customTime on the gRPC object path#184exoego wants to merge 3 commits into
Conversation
UpdateObject rejected the mask paths. Both are now mapped like their siblings. A live GCS probe also set the rules: an unset custom_time or null customTime keeps the value, a decrease is rejected, and only contentEncoding is honoured as an upload query parameter.
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/gcp/services/gcs/GcsCustomTime.java | Centralizes custom-time normalization, protobuf conversion, bounds handling, and monotonicity validation. |
| src/main/java/io/floci/gcp/services/gcs/GcsGrpcMapper.java | Maps cache control and custom time between stored metadata and gRPC objects and update masks. |
| src/main/java/io/floci/gcp/services/gcs/GcsService.java | Applies normalized custom-time patch semantics and rejects decreases. |
| src/main/java/io/floci/gcp/services/gcs/GcsUploadController.java | Limits upload query metadata to content encoding and validates custom time from JSON metadata. |
| src/test/java/io/floci/gcp/services/gcs/GcsGrpcControllerTest.java | Covers gRPC metadata round-tripping, clearing behavior, monotonicity, and malformed timestamp handling. |
| src/test/java/io/floci/gcp/services/gcs/GcsSystemMetadataRestIntegrationTest.java | Covers REST upload and patch behavior against the documented GCS semantics. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
REST[REST upload or patch] --> CT[GcsCustomTime validation]
GRPC[gRPC write or update] --> CT
CT --> META[GcsObjectMeta]
META --> RESTREAD[REST object response]
META --> MAPPER[GcsGrpcMapper]
MAPPER --> GRPCREAD[gRPC GetObject or ListObjects]
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
|
One thing, and it is not about your code: #180 merged since I looked at this and added to Blocking: a rebase, whenever you get a moment. That is our merge ordering, not anything you did. Follow-up: worth recording, since it makes your case stronger than the PR text does — the upload-URL narrowing is in the spec, not only probe-confirmed. Greptile's legacy-timestamp point: your refutation holds, and I checked it rather than taking it. Thank you for chasing the live behaviour rather than guessing — the cross-protocol test is exactly the shape these gaps needed. |
…ntrol-custom-time # Conflicts: # src/test/java/io/floci/gcp/services/gcs/GcsGrpcControllerTest.java
Summary
UpdateObject rejected the mask paths. Both are now mapped like their siblings.
A live GCS probe also set the rules: an unset custom_time or null customTime keeps the value, a decrease is rejected, and only contentEncoding is honoured as an upload query parameter.
Type of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
GetObject/ListObjectsreturned an emptycache_controland nocustom_timefor objects written over REST, andUpdateObjectrejected both mask paths. They now maps both fields.custom_timeunder the mask, or a JSONcustomTime: null, cleared the field. They are now kept.customTimewas accepted. It is now rejected with INVALID_ARGUMENT / 400; the message is pinned in tests.cache_controlunder the mask stored"". It is now unset.customTimewas stored as sent. It is now rendered in UTC and rejected with 400 if unparsable values.contentEncodingis honoured now.Checklist
./mvnw testpasses locally